package com.java复习.练习二;

public class RightTriangle extends Triangle{

    private int Rheight; // 右侧边高
    private double hypotenuse; //斜边

    public RightTriangle(int base, int height) {
        super(base, height);
        Triangle triangle1 = new Triangle(base,height);
        int hypotenuse = (int) Math.sqrt(Math.pow(base,2)+Math.pow(height,2));
        System.out.println("斜边为："+hypotenuse);
        triangle1.setHypotenuse(hypotenuse);
        System.out.println("在Triangle类的构造器中”");
    }

    @Override
    public String toString() {

        return super.toString()+"斜边"+hypotenuse;
    }
}
